﻿using System;
using System.IO;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace syc.Report
{
    public partial class PingHeng : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }
        private void Export()
        {
            string filepath = "/Report/Download/平衡表" + DateTime.Now.ToString("yyyyMMddHHmmffffff") + ".xls";
            string file = Server.MapPath(filepath);
            File.Copy(Server.MapPath("/Report/Templet/平衡表.xls"), (string)file, true);
            ExcelConnection exc = new ExcelConnection(file);
            exc.Open();
            exc.Update("[参数$]", "set [val]='2009年6月30日'", " where [var]='日期'");
            exc.Close();
            Response.Redirect(filepath);
        }
        protected void Button_Export_Click(object sender, EventArgs e)
        {
            Export();
        }
    }
}
